package labelsystem.utils;/**
 * @projectName careOlder
 * @Description TODO
 * @author MCG
 * @time 2023/3/8 17:51
 */

import java.util.HashMap;
import java.util.Map;

/**
 *description: TODO
 *@author MCG
 *@date 2023/3/8 17:51
 *@Version 1.0
 */
public  class  returnMSG {
    //相应状态码
    private int statusCode;
    //信息提示
    private String msg;
    //存储数据
    private Map<String,Object> extend=new HashMap<>();

    public int getStatusCode() {
        return statusCode;
    }

    public Map<String, Object> getExtend() {
        return extend;
    }

    public void setExtend(Map<String, Object> extend) {
        this.extend = extend;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static returnMSG success(){
        returnMSG result=new returnMSG();
        result.setStatusCode(100);
        result.setMsg("success");
        return result;
    }

    public static returnMSG fail(){
        returnMSG result=new returnMSG();
        result.setStatusCode(200);
        result.setMsg("fail");
        return result;
    }

    public  returnMSG add(String key,Object value){
        this.getExtend().put(key,value);
        return this;
    }
}
